#include<iostream>
#include<string>
using namespace std;

class Student
{
private:
	string num;
	string name;
	int gpa[3];
	static int A, B, C, count_1;

public:
	Student(char* name, char* num, int a, int b, int c);
	void display();
	double average1();
	double average2();
	double average3();
};

int Student::A = 0;
int Student::B = 0;
int Student::C = 0;
int Student::count_1 = 0;

Student::Student(char* name, char* num, int a, int b, int c)
{
	this->name = name;
	this->num = num;
	gpa[0] = a;
	gpa[1] = b;
	gpa[2] = c;
	A += a;
	B += b;
	C += c;
	count_1++;
}

void Student::display()
{
	cout << num << " " << name << " " << gpa[0] << " " << gpa[1] << " " << gpa[2] << endl;
}

double Student::average1()
{
	return (double)A / (double)count_1;
}

double Student::average2()
{
	return (double)B / (double)count_1;
}

double Student::average3()
{
	return (double)C / (double)count_1;
}



int main() {
	Student* stu1, * stu2, * stu3;
	char name1[10], name2[10], name3[10];
	char num1[12], num2[12], num3[12];
	int grade1[3], grade2[3], grade3[3];
	cin >> name1 >> num1 >> grade1[0] >> grade1[1] >> grade1[2];
	cin >> name2 >> num2 >> grade2[0] >> grade2[1] >> grade2[2];
	cin >> name3 >> num3 >> grade3[0] >> grade3[1] >> grade3[2];
	stu1 = new Student( num1, name1, grade1[0], grade1[1], grade1[2]);
	stu2 = new Student( num2, name2, grade2[0], grade2[1], grade2[2]);
	stu3 = new Student( num3, name3, grade3[0], grade3[1], grade3[2]);

	stu1->display();
	stu2->display();
	stu3->display();

	cout << "The average grade of course1:" << stu2->average1() << endl;
	cout << "The average grade of course2:" << stu2->average2() << endl;
	cout << "The average grade of course3:" << stu2->average3() << endl;
	return 0;
}